<?php get_component('articlesLeftMenuWidget','render') ?>
<?php use_javascript('/js/basket/script.js'); ?>
<?php use_stylesheet('/enermaatik/tehinfo.css') ?>
<?php use_stylesheet('/enermaatik/laos.css') ?>
<?php slot('product_content') ?>
<?php include_component('headerMenu', 'breadCrumbs') ?>
<div class="clear"></div>
<div class="ccontentbox">
	<div class="ccontent">
		<div class="pealkiri">
			<h1><?php echo $product['name'] ?></h1>
		</div>
		<?php include_partial('productPage/pictures', array('product' => $product, 'pictures' => $pictures)) ?>
		<div class="ccontentright">
			<div class="ccontentrightmain">
				<h1 class="cpealkiri"><?php echo $product['slogan'] ?></h1>
				<div class="rightmaintext">
                                        <?php if(!$product['brand_picture']): ?>
					<p><?php echo $product['brand_name'] ?></p>
                                        <?php else: ?>
                                        <p style="margin-top:-15px;"><img src="<?php echo @myPicture::getInstance($product['brand_picture'])->thumbnail(200, 100)->url() ?>" /></p>
					<?php endif; ?>
                                        <?php if($product['price_actual'] < $product['price']): ?>
						<h2><?php echo price_format($product['price']) ?>
                                                <small>(<?php echo round($product['price'] * 15.6466);?> EEK)</small>
                                                </h2>
                                                
					<?php endif; ?>
					<h2 class="newhind"><?php echo price_format($product['price_actual']) ?>
                                        <small>(<?php echo round($product['price_actual'] * 15.6466);?> EEK)</small>
                                        </h2>
					<div class="clear"></div>
					<?php include_partial('productPage/instockStatus', array('product' => $product)) ?>
					<p><?php echo __('Arvamused tootest') ?>: <a href="#"><?php echo count($comments) ?> <?php echo __('arvamust') ?></a></p>
					<div class="hinne">
						<div class="hinneleft">
						   <p><?php echo __('Toote hinne') ?>:</p>
						</div>
						<div class="hinneright">
							<?php for($i = 1; $i <= ceil($product['rating_sum'] / $product['rating_votes']); ++$i): ?>
							<img src="/enermaatik/img/star.png" alt="" width="14" height="14">
							<?php endfor; ?>
						</div>
						<div class="clear"></div>
					</div>
					<?php include_partial('productPage/share') ?>
				</div>
			</div>
			<div class="ccontentmainbottom"></div>
			<div class="tellimus">
				<div class="kogusform">
					<form method="post" action="">
						<div class="formleft"><img src="/enermaatik/img/formleft.png" alt="" width="10" height="30"></div>
						<div class="formcenter"><input class="kogus" id="qty_box" onblur="if(this.value=='')this.value='1'" onfocus="if(this.value=='1')this.value=''" value="1" name="kogus" maxlength="2" type="text"></div>
						<div class="formright"><img src="/enermaatik/img/formright.png" alt="" width="10" height="30"></div>
					 </form>
					<div class="clear"></div>
				</div>
				<div class="addbutton">
					<div class="addbuttonleft"><img src="/enermaatik/img/rbleft.png" alt="" width="8" height="26"></div>
					<div class="addbuttoncenter">
						<div class="addbuttoncenterleft"><img src="/enermaatik/img/vbasket.png" alt="" width="17" height="13"></div>
						<div class="addbuttoncenterright">
							<input type="hidden" name="qty" value="1" />
							<a class="addToBasket" href="<?php echo $helper->basketLink($product)  ?>"><?php echo __('lisa ostukorvi') ?></a>
						</div>
						<div class="clear"></div>
					</div>
                                        
					<div class="addbuttonright"><img src="/enermaatik/img/rbr.png" alt="" width="8" height="26"></div>
					<div class="clear"></div>
                                        <div id="gotobasket" style="display:none;">
					<div class="addbuttonleft"><img src="/enermaatik/img/rbleft.png" alt="" width="8" height="26"></div>
					<div class="addbuttoncenter">
						<div class="addbuttoncenterleft"><img src="/enermaatik/img/vbasket.png" alt="" width="17" height="13"></div>
						<div class="addbuttoncenterright">
							<a href="<?php echo LinkGen::getInstance(LinkGen::STRUCTURE)->link($basketNode['id']) ?>"><?php echo __('Vaata ostukorvi') ?></a>
						</div>
						<div class="clear"></div>
					</div>
					<div class="addbuttonright"><img src="/enermaatik/img/rbr.png" alt="" width="8" height="26"></div>
					<div class="clear"></div>
                                        </div>
                                        <div style="">
                                          <?php include_partial('categoryPage/like', array('link' => $sf_request->getUri()));?>
                                        </div>
				</div>
				<div class="clear"></div>
			</div>
		</div>
		<div class="clear"></div>
	</div>
	<?php include_partial('productPage/tabs', array('product' => $product, 'parameterArticles' => $parameterArticles['article'])) ?>
</div>

<script type="text/javascript">
	$('.addToBasket').addProductToBasket();
	$('#qty_box').change(function(){
		$('input[name=qty]').val($(this).val());
	});
</script>

<?php end_slot() ?>

<?php get_partial('productPage/connectedProducts', array('connectedProducts' => $connectedProducts, 'filterPage'=>$filterPage[0], 'groupId' => $groupId)) ?>